package com.dkm.ec.activity.schedler;

import com.dkm.ec.activity.repository.CommonActivitySkuRepository;
import com.dkm.ec.activity.repository.TScheduleLockRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * Created by fanjinyuan on 2017/8/18.
 */
@Service
public class CommonActivityScheduler {

    private static final Logger LOG = LoggerFactory.getLogger(CommonActivityScheduler.class);


    @Autowired
    private TScheduleLockRepository scheduleLockRepository;
    @Resource
    private CommonActivitySkuRepository commonActivitySkuRepository;

    @PostConstruct
    public void init(){
        CommonActivityTimer commonActivityTimer = new CommonActivityTimer();
        commonActivityTimer.setScheduleLockRepository(scheduleLockRepository);
        commonActivityTimer.setCommonActivitySkuRepository(commonActivitySkuRepository);
        commonActivityTimer.start();
    }

}


